﻿Public Class ucTraTien
    'biến lưu tên user control nhấn vào sau cùng
    Public TenUserControl As String

    'Hàm thêm user control lên  pnMuaHang
    Public Sub ThemUserControl(uc As UserControl)
        If uc.Name <> TenUserControl Then
            TenUserControl = uc.Name
            pnTraTien.Controls.Clear()
            uc.Dock = DockStyle.Fill
            pnTraTien.Controls.Add(uc)
        End If
    End Sub

    Private Sub btnDanhSachPhieuChi_LinkClicked(sender As Object, e As DevExpress.XtraNavBar.NavBarLinkEventArgs) Handles btnDanhSachPhieuChi.LinkClicked
        Dim uc As New ucDanhSachCongNoPhaiChi
        ThemUserControl(uc)
    End Sub

    Private Sub btnDSPhieuCongNo_LinkClicked(sender As Object, e As DevExpress.XtraNavBar.NavBarLinkEventArgs) Handles btnDSPhieuCongNo.LinkClicked
        Dim uc As New ucDanhSachCongNoPhaiChi
        lbTieuDe.Text = "Danh Sách Công Nợ Phải Chi"
        ThemUserControl(uc)
    End Sub

    Private Sub btnDsPhieuTraNgay_LinkClicked(sender As Object, e As DevExpress.XtraNavBar.NavBarLinkEventArgs) Handles btnDsPhieuTraNgay.LinkClicked
        Dim uc As New ucBangKePhieuThanhToanHangNgay
        lbTieuDe.Text = "Bảng Kê Phiếu Thanh Toán Ngay"
        ThemUserControl(uc)
    End Sub

    Private Sub ucTraTien_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim uc As New ucBangKeTraTien
        uc.Dock = DockStyle.Fill
        lbTieuDe.Text = "Danh Sách Phiếu Chi"
        pnTraTien.Controls.Add(uc)
        TenUserControl = uc.Name
    End Sub
End Class
